Add a helper function that says whether a location should be
considered remote. To determine this, we look at the filesystem
type reported by gvfs, and say 'remote' for sftp, webdav, ftp,
nfs and cifs.
return has_native_path;
}
+
+static const gchar * const remote_types[] = {
+ "sftp",
+ "webdav",
+ "ftp",
+ "nfs",
+ "cifs",
+ NULL
+};
+
+gboolean
+_gtk_file_consider_as_remote (GFile *file)
+{
+ GFileInfo *info;
+ gboolean is_remote;
+
+ info = g_file_query_filesystem_info (file, "filesystem::type", NULL, NULL);
+ if (info)
+ {
+ const gchar *type;
+
+ type = g_file_info_get_attribute_string (info, "filesystem::type");
+ is_remote = g_strv_contains (remote_types, type);
+
+ g_object_unref (info);
+ }
+ else
+ is_remote = FALSE;
+
+ return is_remote;
+}
/* GFile helper functions */
gboolean _gtk_file_has_native_path (GFile *file);
+gboolean _gtk_file_consider_as_remote (GFile *file);
+
G_END_DECLS
#endif /* __GTK_FILE_SYSTEM_H__ */